package ui.panel {

	import ui.component.Page;
	import ui.panel.presences.WarriorInfo;

	public class PresencePanel extends BasePanel {
		
		private var warroirList:Array;
		private var page:Page;

		public function PresencePanel() {
			super();
			pid = PanelType.PRESENCE_PANEL;
		}
		
		override protected function initUI():void {
			super.initUI();
			warroirList = new Array();
			var warrior:WarriorInfo;
			for (var i:int = 0; i<4; i++) {
				warrior = new WarriorInfo();
				warrior.x = i * 140 + 28;
				warrior.y = 40;
				addChild(warrior);
			}
			
			page = new Page(pageHandler);
			page.update(2);
			page.x = 300;
			page.y = 380;
			addChild(page);
		}
		
		public function update(data:Array):void {
			var warrior:WarriorInfo;
			for (var i:int = 0; i<data.length; i++) {
				warrior = warroirList[i];
				if (warrior != null) {
					warrior.update(null);
				}
			}
		}
		
		private function pageHandler(num:uint):void {
			
		}
	}
}